package com.xuan.yrmanage.web.controller_api;



import com.xuan.yrmanage.common.response.ResponseResult;
import com.xuan.yrmanage.domain.Menu;
import com.xuan.yrmanage.domain.User;
import com.xuan.yrmanage.domain.request.QueryPageBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.springframework.web.bind.annotation.PathVariable;
import springfox.documentation.annotations.ApiIgnore;

@Api(value = "系统菜单管理接口",description = "提供系统菜单的增删改查方法")
public interface MenuControllerApi {

    @ApiOperation( value = "分页获取菜单列表")
    @ApiImplicitParams( {
            @ApiImplicitParam(name="pageIndex",value = "当前页",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name="pageSize",value = "每页条数",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name="checkUserId",value = "权限验证的userId",paramType = "query",dataType = "int",required = true,defaultValue = "600001")
    } )
    public ResponseResult findAll(QueryPageBean queryPageBean, @ApiIgnore User user);

    @ApiOperation( value = "添加菜单")
    @ApiImplicitParams( {
            @ApiImplicitParam(name="name",value = "菜单名称",paramType = "query",dataType = "string",required = true),
            @ApiImplicitParam(name="linkUrl",value = "路径",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="priority",value = "排序",paramType = "query",dataType = "string",required = true),
            @ApiImplicitParam(name="icon",value = "图片",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="description",value = "描述",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="parentMenuId",value = "父菜单",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="permissionIds",value = "权限ID的json字符串，格式为[300001,300002]",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="checkUserId",value = "权限验证的userId",paramType = "query",dataType = "int",required = true,defaultValue = "600001")
    } )
    public ResponseResult insertSysMenu(@Ignore Menu menu, String permissionIds, @ApiIgnore User user);

    @ApiOperation( value = "修改菜单")
    @ApiImplicitParams( {
            @ApiImplicitParam(name="id",value = "菜单ID",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name="name",value = "菜单名称",paramType = "query",dataType = "string",required = true),
            @ApiImplicitParam(name="linkUrl",value = "路径",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="priority",value = "排序",paramType = "query",dataType = "string",required = true),
            @ApiImplicitParam(name="icon",value = "图片",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="description",value = "描述",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="parentMenuId",value = "父菜单",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="permissionIds",value = "权限ID的json字符串，格式为[300001,300002]",paramType = "query",dataType = "string",required = false),
            @ApiImplicitParam(name="checkUserId",value = "权限验证的userId",paramType = "query",dataType = "int",required = true,defaultValue = "600001")
    } )
    public ResponseResult updateSysMenu(Integer id, Menu menu, String permissionIds, @ApiIgnore User user);

    @ApiOperation( value = "删除菜单")
    @ApiImplicitParams( {
            @ApiImplicitParam(name="menuId",value = "菜单ID",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name="checkUserId",value = "权限验证的userId",paramType = "query",dataType = "int",required = true,defaultValue = "600001")
    } )
    public ResponseResult deleteSysMenu(Integer menuId, @ApiIgnore User user);


    @ApiOperation(value = "分层返回所有菜单")
    @ApiImplicitParams( {
            @ApiImplicitParam(name="checkUserId",value = "权限验证的userId",paramType = "query",dataType = "int",required = true,defaultValue = "600001")
    } )
    public ResponseResult getAllByLevel(@ApiIgnore User user);


    @ApiOperation(value = "根据菜单返回权限")
    @ApiImplicitParams( {
            @ApiImplicitParam(name="menuId",value = "菜单ID",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name="checkUserId",value = "权限验证的userId",paramType = "query",dataType = "int",required = true,defaultValue = "600001")
    } )
    public ResponseResult getPermissionByMenuId(Integer menuId, @ApiIgnore User user);


    @ApiOperation(value = "获取一级菜单")
    @ApiImplicitParams( {
            @ApiImplicitParam(name="checkUserId",value = "权限验证的userId",paramType = "query",dataType = "int",required = true,defaultValue = "600001")
    } )
    public ResponseResult getOneLevelMenu(@ApiIgnore User user);




}
